Appearance
下载MySQL YUM仓库
wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm
安装MySQL8
yum install mysql-community-server -y
启动
systemctl start mysql
显示root临时密码
grep "A temporary password" /var/log/mysqld.log
~~<font style="color:rgb(51, 51, 51);">sudo rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm</font>~~
<font style="color:rgb(51, 51, 51);">sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql</font>
Question:
``
<font style="color:rgb(51, 51, 51);">sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup</font>
<font style="color:rgb(51, 51, 51);">sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</font>
<font style="color:rgb(51, 51, 51);">sudo yum clean all sudo yum makecache</font>
~~<font style="color:rgb(51, 51, 51);">alter user root@localhost identified by 'MySQLroot123#';</font>~~
<font style="color:rgb(51, 51, 51);">SHOW VARIABLES LIKE 'validate_password%';</font>
<font style="color:rgb(51, 51, 51);">UNINSTALL PLUGIN validate_password;</font>
<font style="color:rgb(51, 51, 51);">SET GLOBAL validate_password.policy=LOW; SET GLOBAL validate_password.length=6;</font>
<font style="color:rgb(51, 51, 51);">ALTER USER 'root'@'localhost' IDENTIFIED BY 'Uu2T%gkewr4^N7ZQ6z@P';</font>
<font style="color:rgb(51, 51, 51);">systemctl start mysqld.service</font>
- _****__****_
- _****__****__****_